<%= stylesheet_link_tag 'blog_kit' %>
<h1>Tutti i blog</h1>

<table>
  <tr>
    <th>Titolo</th>
	<th>Autore</th>
  </tr>

<% @blogs.each do |blog| %>
  <tr>
    <td><%=h blog.title %></td>
	<td><%=h blog.user.name %></td>
    
	<td><%= link_to 'Mostra', blog %></td>
    <td><%= link_to 'Modifica', edit_blog_path(blog) if (logged_in? and current_user.is_my_blog? blog.id)%></td>
    <td><%= link_to 'Cancella', blog, :confirm => 'Sei sicuro di voler eliminare questo blog?', :method => :delete if (logged_in? and current_user.is_my_blog? blog.id)%></td>
  </tr>
<% end %>
</table>

<br />